import React, { Component } from 'react';
import SampleChart from '../../component/SampleChart';

class BookChart extends Component {
    bookData = [
        [
            { genre: '淘宝', sold: 275 },
            { genre: '京东', sold: 1150 },
            { genre: '天猫', sold: 120 },
            { genre: '亚马逊', sold: 350 },
            { genre: '当当', sold: 150 },
        ],
        [
            { genre: '淘宝', sold: 451 },
            { genre: '京东', sold: 300 },
            { genre: '天猫', sold: 120 },
            { genre: '亚马逊', sold: 600 },
            { genre: '当当', sold: 150 },
        ],
        [
            { genre: '淘宝', sold: 564 },
            { genre: '京东', sold: 500 },
            { genre: '天猫', sold: 411 },
            { genre: '亚马逊', sold: 350 },
            { genre: '当当', sold: 666 },
        ],
        [
            { genre: '淘宝', sold: 153 },
            { genre: '京东', sold: 945 },
            { genre: '天猫', sold: 875 },
            { genre: '亚马逊', sold: 666 },
            { genre: '当当', sold: 789 },
        ]
    ];


    render() {
        return (
            <div>
                {
                    this.bookData.map((element, index) => {
                        return (
                            <div key={index}>
                                <div>书籍{index}销售数据</div>
                                <SampleChart data={element} />
                            </div>
                        );
                    })
                }
            </div >
        );
    }
}

export default BookChart;